#pragma once
#include "f2c.h"

using namespace System;

namespace SmartMathLibrary
{
	namespace Blas
	{
		namespace Engine
		{
			public ref class ManagedBlasProvider
			{
			public:
				/*	static real 
				sdot_(integer* N, 
				real* X, integer* incX, 
				real* Y, integer* incY);*/

				static doublereal ddot_(integer *N, doublereal *X, integer *incX,
					doublereal *Y, integer *incY);

				static void cdotu_(complex *retval, integer *N, complex *X, integer *incX,
					complex *Y, integer *incY);

				static void cdotc_(complex *retval, integer *N, complex *X, integer *incX,
					complex *Y, integer *incY);

				static void zdotu_(doublecomplex *retval, integer *N, doublecomplex *X,
					integer *incX, doublecomplex *Y, integer *incY);

				static void zdotc_(doublecomplex *retval, integer *N, doublecomplex *X,
					integer *incX, doublecomplex *Y, integer *incY);

				//static real 
				//snrm2_(integer* N, 
				//       real* X, integer* incX);
				//
				//static real
				//sasum_(integer* N, 
				//       real* X, integer* incX);

				static doublereal dnrm2_(integer *N, doublereal *X, integer *incX);

				static doublereal dasum_(integer *N, doublereal *X, integer *incX);

				//static real 
				//scnrm2_(integer* N, 
				//        complex* X, integer* incX);

				//static real
				//scasum_(integer* N, 
				//        complex* X, integer* incX);

				static doublereal dznrm2_(integer *N, doublecomplex *X, integer *incX);

				static doublereal dzasum_(integer *N, doublecomplex *X, integer *incX);

				static integer isamax_(integer *N, real *X, integer *incX);

				static integer idamax_(integer *N, doublereal *X, integer *incX);

				static integer icamax_(integer *N, complex *X, integer *incX);

				static integer izamax_(integer *N, doublecomplex *X, integer *incX);

				static int sswap_(integer *N, real *X, integer *incX, real *Y, integer
					*incY);

				static int scopy_(integer *N, real *X, integer *incX, real *Y, integer
					*incY);

				static int saxpy_(integer *N, real *alpha, real *X, integer *incX, real
					*Y, integer *incY);

				static int dswap_(integer *N, doublereal *X, integer *incX, doublereal *Y,
					integer *incY);

				static int dcopy_(integer *N, doublereal *X, integer *incX, doublereal *Y,
					integer *incY);

				static int daxpy_(integer *N, doublereal *alpha, doublereal *X, integer
					*incX, doublereal *Y, integer *incY);

				static int cswap_(integer *N, complex *X, integer *incX, complex *Y,
					integer *incY);

				static int ccopy_(integer *N, complex *X, integer *incX, complex *Y,
					integer *incY);

				static int caxpy_(integer *N, complex *alpha, complex *X, integer *incX,
					complex *Y, integer *incY);

				static int zswap_(integer *N, doublecomplex *X, integer *incX,
					doublecomplex *Y, integer *incY);

				static int zcopy_(integer *N, doublecomplex *X, integer *incX,
					doublecomplex *Y, integer *incY);

				static int zaxpy_(integer *N, doublecomplex *alpha, doublecomplex *X,
					integer *incX, doublecomplex *Y, integer *incY);

				static int srotg_(real *a, real *b, real *c, real *s);

				static int srot_(integer *N, real *X, integer *incX, real *Y, integer
					*incY, real *c, real *s);

				static int drotg_(doublereal *a, doublereal *b, doublereal *c, doublereal
					*s);

				static int drot_(integer *N, doublereal *X, integer *incX, doublereal *Y,
					integer *incY, doublereal *c, doublereal *s);

				static int csrot_(integer *N, complex *X, integer *incX, complex *Y,
					integer *incY, real *c, real *s);

				static int zdrot_(integer *N, doublecomplex *X, integer *incX,
					doublecomplex *Y, integer *incY, doublereal *c, doublereal *s);

				static int sscal_(integer *N, real *alpha, real *X, integer *incX);

				static int dscal_(integer *N, doublereal *alpha, doublereal *X, integer
					*incX);

				static int cscal_(integer *N, complex *alpha, complex *X, integer *incX);

				static int zscal_(integer *N, doublecomplex *alpha, doublecomplex *X,
					integer *incX);

				static int csscal_(integer *N, real *alpha, complex *X, integer *incX);

				static int zdscal_(integer *N, doublereal *alpha, doublecomplex *X,
					integer *incX);

				static int sgemv_(char *trans, integer *M, integer *N, real *alpha, real
					*A, integer *lda, real *X, integer *incX, real *beta, real *Y, integer
					*incY);

				static int sgbmv_(char *trans, integer *M, integer *N, integer *KL,
					integer *KU, real *alpha, real *A, integer *lda, real *X, integer *incX,
					real *beta, real *Y, integer *incY);

				static int strmv_(char *uplo, char *trans, char *diag, integer *N, real
					*A, integer *lda, real *X, integer *incX);

				static int stbmv_(char *uplo, char *trans, char *diag, integer *N,
					integer *K, real *A, integer *lda, real *X, integer *incX);

				static int stpmv_(char *uplo, char *trans, char *diag, integer *N, real
					*Ap, real *X, integer *incX);

				static int strsv_(char *uplo, char *trans, char *diag, integer *N, real
					*A, integer *lda, real *X, integer *incX);

				static int stbsv_(char *uplo, char *trans, char *diag, integer *N,
					integer *K, real *A, integer *lda, real *X, integer *incX);

				static int stpsv_(char *uplo, char *trans, char *diag, integer *N, real
					*Ap, real *X, integer *incX);

				static int dgemv_(char *trans, integer *M, integer *N, doublereal *alpha,
					doublereal *A, integer *lda, doublereal *X, integer *incX, doublereal
					*beta, doublereal *Y, integer *incY);

				static int dgbmv_(char *trans, integer *M, integer *N, integer *KL,
					integer *KU, doublereal *alpha, doublereal *A, integer *lda, doublereal
					*X, integer *incX, doublereal *beta, doublereal *Y, integer *incY);

				static int dtrmv_(char *uplo, char *trans, char *diag, integer *N,
					doublereal *A, integer *lda, doublereal *X, integer *incX);

				static int dtbmv_(char *uplo, char *trans, char *diag, integer *N,
					integer *K, doublereal *A, integer *lda, doublereal *X, integer *incX);

				static int dtpmv_(char *uplo, char *trans, char *diag, integer *N,
					doublereal *Ap, doublereal *X, integer *incX);

				static int dtrsv_(char *uplo, char *trans, char *diag, integer *N,
					doublereal *A, integer *lda, doublereal *X, integer *incX);

				static int dtbsv_(char *uplo, char *trans, char *diag, integer *N,
					integer *K, doublereal *A, integer *lda, doublereal *X, integer *incX);

				static int dtpsv_(char *uplo, char *trans, char *diag, integer *N,
					doublereal *Ap, doublereal *X, integer *incX);

				static int cgemv_(char *trans, integer *M, integer *N, complex *alpha,
					complex *A, integer *lda, complex *X, integer *incX, complex *beta,
					complex *Y, integer *incY);

				static int cgbmv_(char *trans, integer *M, integer *N, integer *KL,
					integer *KU, complex *alpha, complex *A, integer *lda, complex *X,
					integer *incX, complex *beta, complex *Y, integer *incY);

				static int ctrmv_(char *uplo, char *trans, char *diag, integer *N,
					complex *A, integer *lda, complex *X, integer *incX);

				static int ctbmv_(char *uplo, char *trans, char *diag, integer *N,
					integer *K, complex *A, integer *lda, complex *X, integer *incX);

				static int ctpmv_(char *uplo, char *trans, char *diag, integer *N,
					complex *Ap, complex *X, integer *incX);

				static int ctrsv_(char *uplo, char *trans, char *diag, integer *N,
					complex *A, integer *lda, complex *X, integer *incX);

				static int ctbsv_(char *uplo, char *trans, char *diag, integer *N,
					integer *K, complex *A, integer *lda, complex *X, integer *incX);

				static int ctpsv_(char *uplo, char *trans, char *diag, integer *N,
					complex *Ap, complex *X, integer *incX);

				static int zgemv_(char *trans, integer *M, integer *N, doublecomplex
					*alpha, doublecomplex *A, integer *lda, doublecomplex *X, integer *incX,
					doublecomplex *beta, doublecomplex *Y, integer *incY);

				static int zgbmv_(char *trans, integer *M, integer *N, integer *KL,
					integer *KU, doublecomplex *alpha, doublecomplex *A, integer *lda,
					doublecomplex *X, integer *incX, doublecomplex *beta, doublecomplex *Y,
					integer *incY);

				static int ztrmv_(char *uplo, char *trans, char *diag, integer *N,
					doublecomplex *A, integer *lda, doublecomplex *X, integer *incX);

				static int ztbmv_(char *uplo, char *trans, char *diag, integer *N,
					integer *K, doublecomplex *A, integer *lda, doublecomplex *X, integer
					*incX);

				// static void  
				//ztpmv_(char* uplo, char* trans, char* diag, integer* N, 
				//      doublecomplex* Ap, 
				//      doublecomplex* X, integer* incX);

				static int ztrsv_(char *uplo, char *trans, char *diag, integer *N,
					doublecomplex *A, integer *lda, doublecomplex *X, integer *incX);

				static int ztbsv_(char *uplo, char *trans, char *diag, integer *N,
					integer *K, doublecomplex *A, integer *lda, doublecomplex *X, integer
					*incX);

				static int ztpsv_(char *uplo, char *trans, char *diag, integer *N,
					doublecomplex *Ap, doublecomplex *X, integer *incX);

				static int ssymv_(char *uplo, integer *N, real *alpha, real *A, integer
					*lda, real *X, integer *incX, real *beta, real *Y, integer *incY);

				static int ssbmv_(char *uplo, integer *N, integer *K, real *alpha, real
					*A, integer *lda, real *X, integer *incX, real *beta, real *Y, integer
					*incY);

				static int sspmv_(char *uplo, integer *N, real *alpha, real *Ap, real *X,
					integer *incX, real *beta, real *Y, integer *incY);

				static int sger_(integer *M, integer *N, real *alpha, real *X, integer
					*incX, real *Y, integer *incY, real *A, integer *lda);

				static int ssyr_(char *uplo, integer *N, real *alpha, real *X, integer
					*incX, real *A, integer *lda);

				static int sspr_(char *uplo, integer *N, real *alpha, real *X, integer
					*incX, real *Ap);

				static int ssyr2_(char *uplo, integer *N, real *alpha, real *X, integer
					*incX, real *Y, integer *incY, real *A, integer *lda);

				static int sspr2_(char *uplo, integer *N, real *alpha, real *X, integer
					*incX, real *Y, integer *incY, real *A);

				static int dsymv_(char *uplo, integer *N, doublereal *alpha, doublereal
					*A, integer *lda, doublereal *X, integer *incX, doublereal *beta,
					doublereal *Y, integer *incY);

				static int dsbmv_(char *uplo, integer *N, integer *K, doublereal *alpha,
					doublereal *A, integer *lda, doublereal *X, integer *incX, doublereal
					*beta, doublereal *Y, integer *incY);

				static int dspmv_(char *uplo, integer *N, doublereal *alpha, doublereal
					*Ap, doublereal *X, integer *incX, doublereal *beta, doublereal *Y,
					integer *incY);

				static int dger_(integer *M, integer *N, doublereal *alpha, doublereal *X,
					integer *incX, doublereal *Y, integer *incY, doublereal *A, integer
					*lda);

				static int dsyr_(char *uplo, integer *N, doublereal *alpha, doublereal *X,
					integer *incX, doublereal *A, integer *lda);

				static int dspr_(char *uplo, integer *N, doublereal *alpha, doublereal *X,
					integer *incX, doublereal *Ap);

				static int dsyr2_(char *uplo, integer *N, doublereal *alpha, doublereal
					*X, integer *incX, doublereal *Y, integer *incY, doublereal *A, integer
					*lda);

				static int dspr2_(char *uplo, integer *N, doublereal *alpha, doublereal
					*X, integer *incX, doublereal *Y, integer *incY, doublereal *A);

				static int chemv_(char *uplo, integer *N, complex *alpha, complex *A,
					integer *lda, complex *X, integer *incX, complex *beta, complex *Y,
					integer *incY);

				static int chbmv_(char *uplo, integer *N, integer *K, complex *alpha,
					complex *A, integer *lda, complex *X, integer *incX, complex *beta,
					complex *Y, integer *incY);

				static int chpmv_(char *uplo, integer *N, complex *alpha, complex *Ap,
					complex *X, integer *incX, complex *beta, complex *Y, integer *incY);

				static int cgeru_(integer *M, integer *N, complex *alpha, complex *X,
					integer *incX, complex *Y, integer *incY, complex *A, integer *lda);

				static int cgerc_(integer *M, integer *N, complex *alpha, complex *X,
					integer *incX, complex *Y, integer *incY, complex *A, integer *lda);

				static int cher_(char *uplo, integer *N, real *alpha, complex *X, integer
					*incX, complex *A, integer *lda);

				static int chpr_(char *uplo, integer *N, real *alpha, complex *X, integer
					*incX, complex *Ap);

				static int cher2_(char *uplo, integer *N, complex *alpha, complex *X,
					integer *incX, complex *Y, integer *incY, complex *A, integer *lda);

				static int chpr2_(char *uplo, integer *N, complex *alpha, complex *X,
					integer *incX, complex *Y, integer *incY, complex *Ap);

				static int zhemv_(char *uplo, integer *N, doublecomplex *alpha,
					doublecomplex *A, integer *lda, doublecomplex *X, integer *incX,
					doublecomplex *beta, doublecomplex *Y, integer *incY);

				static int zhbmv_(char *uplo, integer *N, integer *K, doublecomplex
					*alpha, doublecomplex *A, integer *lda, doublecomplex *X, integer *incX,
					doublecomplex *beta, doublecomplex *Y, integer *incY);

				static int zhpmv_(char *uplo, integer *N, doublecomplex *alpha,
					doublecomplex *Ap, doublecomplex *X, integer *incX, doublecomplex *beta,
					doublecomplex *Y, integer *incY);

				static int zgeru_(integer *M, integer *N, doublecomplex *alpha,
					doublecomplex *X, integer *incX, doublecomplex *Y, integer *incY,
					doublecomplex *A, integer *lda);

				static int zgerc_(integer *M, integer *N, doublecomplex *alpha,
					doublecomplex *X, integer *incX, doublecomplex *Y, integer *incY,
					doublecomplex *A, integer *lda);

				static int zher_(char *uplo, integer *N, doublereal *alpha, doublecomplex
					*X, integer *incX, doublecomplex *A, integer *lda);

				static int zhpr_(char *uplo, integer *N, doublereal *alpha, doublecomplex
					*X, integer *incX, doublecomplex *Ap);

				static int zher2_(char *uplo, integer *N, doublecomplex *alpha,
					doublecomplex *X, integer *incX, doublecomplex *Y, integer *incY,
					doublecomplex *A, integer *lda);

				static int zhpr2_(char *uplo, integer *N, doublecomplex *alpha,
					doublecomplex *X, integer *incX, doublecomplex *Y, integer *incY,
					doublecomplex *Ap);

				static int sgemm_(char *transA, char *transB, integer *M, integer *N,
					integer *K, real *alpha, real *A, integer *lda, real *B, integer *ldb,
					real *beta, real *C, integer *ldc);

				static int ssymm_(char *side, char *uplo, integer *M, integer *N, real
					*alpha, real *A, integer *lda, real *B, integer *ldb, real *beta, real
					*C, integer *ldc);

				static int ssyrk_(char *uplo, char *trans, integer *N, integer *K, real
					*alpha, real *A, integer *lda, real *beta, real *C, integer *ldc);

				static int ssyr2k_(char *uplo, char *trans, integer *N, integer *K, real
					*alpha, real *A, integer *lda, real *B, integer *ldb, real *beta, real
					*C, integer *ldc);

				static int strmm_(char *side, char *uplo, char *trans, char *diag,
					integer *M, integer *N, real *alpha, real *A, integer *lda, real *B,
					integer *ldb);

				static int strsm_(char *side, char *uplo, char *trans, char *diag,
					integer *M, integer *N, real *alpha, real *A, integer *lda, real *B,
					integer *ldb);

				static int dgemm_(char *transA, char *transB, integer *M, integer *N,
					integer *K, doublereal *alpha, doublereal *A, integer *lda, doublereal
					*B, integer *ldb, doublereal *beta, doublereal *C, integer *ldc);

				static int dsymm_(char *side, char *uplo, integer *M, integer *N,
					doublereal *alpha, doublereal *A, integer *lda, doublereal *B, integer
					*ldb, doublereal *beta, doublereal *C, integer *ldc);

				static int dsyrk_(char *uplo, char *trans, integer *N, integer *K,
					doublereal *alpha, doublereal *A, integer *lda, doublereal *beta,
					doublereal *C, integer *ldc);

				static int dsyr2k_(char *uplo, char *trans, integer *N, integer *K,
					doublereal *alpha, doublereal *A, integer *lda, doublereal *B, integer
					*ldb, doublereal *beta, doublereal *C, integer *ldc);

				static int dtrmm_(char *side, char *uplo, char *trans, char *diag,
					integer *M, integer *N, doublereal *alpha, doublereal *A, integer *lda,
					doublereal *B, integer *ldb);

				static int dtrsm_(char *side, char *uplo, char *trans, char *diag,
					integer *M, integer *N, doublereal *alpha, doublereal *A, integer *lda,
					doublereal *B, integer *ldb);

				static int cgemm_(char *transA, char *transB, integer *M, integer *N,
					integer *K, complex *alpha, complex *A, integer *lda, complex *B,
					integer *ldb, complex *beta, complex *C, integer *ldc);

				static int csymm_(char *side, char *uplo, integer *M, integer *N, complex
					*alpha, complex *A, integer *lda, complex *B, integer *ldb, complex
					*beta, complex *C, integer *ldc);

				static int csyrk_(char *uplo, char *trans, integer *N, integer *K,
					complex *alpha, complex *A, integer *lda, complex *beta, complex *C,
					integer *ldc);

				static int csyr2k_(char *uplo, char *trans, integer *N, integer *K,
					complex *alpha, complex *A, integer *lda, complex *B, integer *ldb,
					complex *beta, complex *C, integer *ldc);

				static int ctrmm_(char *side, char *uplo, char *trans, char *diag,
					integer *M, integer *N, complex *alpha, complex *A, integer *lda,
					complex *B, integer *ldb);

				static int ctrsm_(char *side, char *uplo, char *trans, char *diag,
					integer *M, integer *N, complex *alpha, complex *A, integer *lda,
					complex *B, integer *ldb);

				static int zgemm_(char *transA, char *transB, integer *M, integer *N,
					integer *K, doublecomplex *alpha, doublecomplex *A, integer *lda,
					doublecomplex *B, integer *ldb, doublecomplex *beta, doublecomplex *C,
					integer *ldc);

				static int zsymm_(char *side, char *uplo, integer *M, integer *N,
					doublecomplex *alpha, doublecomplex *A, integer *lda, doublecomplex *B,
					integer *ldb, doublecomplex *beta, doublecomplex *C, integer *ldc);

				static int zsyrk_(char *uplo, char *trans, integer *N, integer *K,
					doublecomplex *alpha, doublecomplex *A, integer *lda, doublecomplex
					*beta, doublecomplex *C, integer *ldc);

				static int zsyr2k_(char *uplo, char *trans, integer *N, integer *K,
					doublecomplex *alpha, doublecomplex *A, integer *lda, doublecomplex *B,
					integer *ldb, doublecomplex *beta, doublecomplex *C, integer *ldc);

				static int ztrmm_(char *side, char *uplo, char *trans, char *diag,
					integer *M, integer *N, doublecomplex *alpha, doublecomplex *A, integer
					*lda, doublecomplex *B, integer *ldb);

				static int ztrsm_(char *side, char *uplo, char *trans, char *diag,
					integer *M, integer *N, doublecomplex *alpha, doublecomplex *A, integer
					*lda, doublecomplex *B, integer *ldb);

				static int chemm_(char *side, char *uplo, integer *M, integer *N, complex
					*alpha, complex *A, integer *lda, complex *B, integer *ldb, complex
					*beta, complex *C, integer *ldc);

				static int cherk_(char *uplo, char *trans, integer *N, integer *K, real
					*alpha, complex *A, integer *lda, real *beta, complex *C, integer *ldc);

				static int cher2k_(char *uplo, char *trans, integer *N, integer *K,
					complex *alpha, complex *A, integer *lda, complex *B, integer *ldb,
					real *beta, complex *C, integer *ldc);

				static int zhemm_(char *side, char *uplo, integer *M, integer *N,
					doublecomplex *alpha, doublecomplex *A, integer *lda, doublecomplex *B,
					integer *ldb, doublecomplex *beta, doublecomplex *C, integer *ldc);

				static int zherk_(char *uplo, char *trans, integer *N, integer *K,
					doublereal *alpha, doublecomplex *A, integer *lda, doublereal *beta,
					doublecomplex *C, integer *ldc);

				static int zher2k_(char *uplo, char *trans, integer *N, integer *K,
					doublecomplex *alpha, doublecomplex *A, integer *lda, doublecomplex *B,
					integer *ldb, doublereal *beta, doublecomplex *C, integer *ldc);

				static int zrotg_(doublecomplex *ca, doublecomplex *cb, doublereal *c__,
					doublecomplex *s);

				static int drotm_(integer *n, doublereal *dx, integer *incx, doublereal
					*dy, integer *incy, doublereal *dparam);

				static int drotmg_(doublereal *dd1, doublereal *dd2, doublereal *dx1,
					doublereal *dy1, doublereal *dparam);

				static doublereal dsdot_(integer *n, real *sx, integer *incx, real *sy,
					integer *incy);

				static doublereal scabs1_(complex *z__);

				static doublereal sdsdot_(integer *n, real *sb, real *sx, integer*incx,
					real *sy, integer *incy);

				static int srotm_(integer *n, real *sx, integer *incx, real *sy, integer
					*incy, real *sparam);

				static int srotmg_(real *sd1, real *sd2, real *sx1, real *sy1,
					real*sparam);

				static int xerbla_(char *srname, integer *info);

				static logical lsame_(char *ca, char *cb);

				static doublereal dcabs1_(doublecomplex *z__);

				static int crotg_(complex *ca, complex *cb, real *c__, complex *s);

				/*static int zrotg_(doublecomplex *ca, doublecomplex *cb, doublereal 
				*c__, doublecomplex *s);*/
			};
		}
	}
}